import {get } from '@/utils/request';
import storeUser from './user';
export default {
    namespaced: true,
    state: {
        userAddress: [],
        filterToShopCartList: [],
        goodDetailDataItem: []
    },
    mutations: {},
    actions: {
        // 获取订单列表
        getOrderList({ commit }, payload) {
            return new Promise((resolve, reject) => {
                get(`/order?project_id=${storeUser.state.project_id}&status=${payload.status}`)
                    .then(res => {
                        resolve(res.data);
                    })
                    .catch(err => {
                        reject(err);
                    });
            });
        },
        // 获取购物车列表
        getShopCart({ commit }, payload) {
            return new Promise((resolve, reject) => {
                get('/shoppingCart?project_id=' + payload)
                    .then(res => {
                        resolve(res.data);
                    })
                    .catch(err => {
                        reject(err);
                    });
            });
        }
    }
};